package main

func Sum[T Number](vals ...T) T {
	var res T
	for _, val := range vals {
		res = res + val
	}
	return res
}

// 泛型约束
type Number interface {
	~int | int64 | float64 | int32 | float32
}

// 延伸类型
type Integer int
